package cadastro.projeto;

import android.app.Activity;
import java.util.ArrayList;
import com.example.primeiraaplicacao.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.Toast;

public class CadastroProjeto extends Activity {
	
	private ArrayList<String> serv = new ArrayList<String>();
	
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.cadastroprojeto);
		Spinner sp = (Spinner) findViewById(R.id.spinner1);
		serv.add("Selecione");
		serv.add("Yahoo");
		serv.add("Gmail");
		serv.add("Outlook");
		ArrayAdapter<String> adaptador = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, serv);
		adaptador.setDropDownViewResource(android.R.layout.simple_spinner_item);
		sp.setAdapter(adaptador);
	}


	public boolean onCreateOptionsMenu(Menu menu){
		super.onCreateOptionsMenu(menu);
		menu.add(0,0,0,"Salvar");
		menu.add(0,1,0,"Sair");
		return true;
	}
	public boolean onMenuItemSelected(int featuredId, MenuItem item){
		switch (item.getItemId()) {
		case 0:
			Toast.makeText(this, "Salvar", Toast.LENGTH_SHORT).show();
			break;
		case 1:
			Toast.makeText(this, "Sair", Toast.LENGTH_SHORT).show();
			break;
		}
		return false;
	}

}

